package gamestate;

import gui.user.User;

import java.awt.Graphics2D;

public abstract class State 
{
	/**
	 * State Stack that handles the game states
	 */
	private StateStack ss;
	/**
	 * The user that handles input
	 */
	private User user;
	
	/**
	 * @param duration time it took to start frame
	 */
	public abstract void update( double duration );
	/**
	 * @param g graphics to draw to
	 */
	public abstract void render( Graphics2D g );
	
	/**
	 * Constructor
	 * 
	 * @param s StateStack that handles the transition between states. required for all states
	 * @param u User that handles input. required for all states
	 * @param si StoredImages that holds all images used. required for all states
	 */
	public State( StateStack s, User u )
	{
		ss = s;
		user = u;
	}
	
	/**
	 * @return the StateStack in use
	 */
	protected StateStack getStack()
	{
		return ss;
	}
	
	/**
	 * @return the User in use
	 */
	protected User getUser()
	{
		return user;
	}
}
